home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / init.d / tails-kexec < prev    next >
Encoding:
Text File  |  2013-01-06  |  3.7 KB  |  116 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:        tails-kexec
  4. # Required-Start:    
  5. # Required-Stop:    halt reboot
  6. # X-Stop-After:        umountroot live-boot
  7. # Default-Start:
  8. # Default-Stop:        0 6
  9. # X-Interactive:    true
  10. # Short-Description: Execute the kexec -e command to reboot system
  11. # Description:
  12. ### END INIT INFO
  13.  
  14. # FIXME: this script should be translatable in a better way than the
  15. # ugly case..esac thing. Note that using gettext at this point -i.e.
  16. # after the DVD has been ejected- is probably too brittle. A possible
  17. # solution would be to turn this script into a .in file, with
  18. # placeholders for translatable string. Translatable strings and their
  19. # translations could be managed by ikiwiki+po, and the placeholders
  20. # could be replaced at boot time -depending on the chosen locale- by
  21. # the appropriate strings. Unfortunately po4a does not support shell
  22. # scripts.
  23.  
  24. PATH=/sbin:/bin
  25.  
  26. print_text () {
  27.    echo "$1" > /dev/console
  28. }
  29.  
  30. print_empty_line () {
  31.    print_text ''
  32. }
  33.  
  34. do_stop () {
  35.    test "x`/bin/cat /sys/kernel/kexec_loaded`y" = "x1y" || exit 0
  36.  
  37.    /bin/stty sane < /dev/console
  38.  
  39.    print_empty_line
  40.    print_empty_line
  41.    print_text "--------------------------------------------------------------------------------"
  42.  
  43.    # $LANG was set there by the FIXME live-config upstream script
  44.    . /etc/default/locale
  45.  
  46.    # Note to translators: any text line must fit on a 80 characters wide screen
  47.    case "${LANG}" in
  48.       es_ES.UTF-8)
  49.      print_text "              Puede ahora retirar el DVD o el USB de arranque."
  50.      print_empty_line
  51.      print_text "       Se borrar├í dentro de pocos segundos la memoria RAM del sistema..."
  52.      print_empty_line
  53.      print_text "Pueden aparecer problemas de visualizaci├│n en el monitor durante esta operaci├│n."
  54.      print_empty_line
  55.      print_text "      If the system does not power off automatically in a few seconds,"
  56.      print_text "                  it may mean the memory wiping has failed."
  57.      ;;
  58.       fr_FR.UTF-8)
  59.      print_text "            Vous pouvez maintenant retirer le DVD / cl├⌐ USB de boot."
  60.      print_empty_line
  61.      print_text "           La m├⌐moire vive va ├¬tre effac├⌐e dans quelques secondes..."
  62.      print_empty_line
  63.      print_text "   Il est possible que l'affichage soit corrompu au cours de cette op├⌐ration."
  64.      print_empty_line
  65.      print_text "    Si l'ordinateur ne s'├⌐teint pas automatiquement apr├¿s quelques secondes,"
  66.      print_text "           il est possible que l'effacement de la m├⌐moire ait ├⌐chou├⌐."
  67.      ;;
  68.       it*)
  69.      print_text "              Adesso puoi rimuovere il cd o la penna USB."
  70.      print_empty_line
  71.      print_text "       La memoria del computer verra' cancellata tra pochi secondi..."
  72.      print_empty_line
  73.      print_text "        Il display potra' essere corrotto durante questa operazione."
  74.      print_empty_line
  75.      print_text "      Se vostro PC non si spegnera' automaticamente in pochi secondi"
  76.      print_text "        la cancellazione della memoria putrebbe essere incompleta."
  77.  
  78.      ;;
  79.       *)
  80.      print_text "               You can now remove the boot DVD or USB stick."
  81.      print_empty_line
  82.      print_text "         The system memory is going to be wiped in a few seconds..."
  83.      print_empty_line
  84.      print_text "             Display might be corrupted during this operation."
  85.      print_empty_line
  86.      print_text "      If the system does not power off automatically in a few seconds,"
  87.      print_text "                  it may mean the memory wiping has failed."
  88.      ;;
  89.    esac
  90.  
  91.    print_text "--------------------------------------------------------------------------------"
  92.    print_empty_line
  93.    print_empty_line
  94.  
  95.    /bin/sleep 5
  96.    /sbin/kexec -e --reset-vga
  97. }
  98.  
  99. case "$1" in
  100.   start)
  101.     # No-op
  102.     ;;
  103.   restart|reload|force-reload)
  104.     echo "Error: argument '$1' not supported" >&2
  105.     exit 3
  106.     ;;
  107.   stop)
  108.     do_stop
  109.     ;;
  110.   *)
  111.     echo "Usage: $0 start|stop" >&2
  112.     exit 3
  113.     ;;
  114. esac
  115. exit 0
  116.